<link href="../includes/style.css" rel="stylesheet" type="text/css" />     


<title>Item Specialization Page</title>
 

<?php

/*

***************************************
*                                     *
* Copyright 2011 David Matthew Pugh   *
* Contact Info:thebravedave@gmail.com *
*                                     *
***************************************

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
    
require_once "../services/webservices.php";
require_once "index.php";





if(isset($_GET['gw_id']) && !isset($_GET['getitemoptions']))
{
?>
<br /><br /><br /><br />

<form action = "./updateitem.php" method="POST">
<input type="hidden" name="gw_id" value="<?php echo $_GET['gw_id'];?>" />
<input type="hidden" name="Edit_Button" vaue="Edit_Button" />
<input type="submit" name="submit" value="go back"><br /><br />
</form>
 <b>Add Specialization Categories/Descriptors</b>
 <div class="smallcore">
 <form action="item_options.php" method="GET">
 <input type="hidden" name="gw_id" id="gw_id" value="<?php echo $_GET['gw_id']?>">
 <b>How Many Categories:</b><select name="number_categories">
 <option value="1">1</option>
 <option value="2">2</option>
 <option value="3">3</option>
 <option value="4">4</option>
 <option value="5">5</option>
 <option value="6">6</option>
 <option value="7">7</option>
 <option value="8">8</option>
 <option value="9">9</option>
 <option value="10">10</option>
 </select>
 <input type="submit" value="submit categories">
</form>
<br /><br /><br />
<?php

}

if(isset($_GET['gw_id']) && isset($_GET['number_categories']) && !isset($_GET['getdescriptors']) && !isset($_GET['itemoptions']))
{
    $gw_id = $_GET['gw_id'];
    $num_cat = $_GET['number_categories'];
?>
    <form action="item_options.php">
        <input type="hidden" name="gw_id" value="<?php echo $gw_id ?>"/>
        <input type="hidden" name="number_categories" value="<?php echo $num_cat ?>"/>
        <input type="hidden" name="getdescriptors" value="getdescriptors"/>
   

<?php
    
    
    $tmp_num = 0;
    while($tmp_num != $num_cat)
    {
        $tmp_num++;
        $cat_num = "category" . $tmp_num;
        $desc_num = "descriptors" . $tmp_num;
?>  
        Category # <?php echo $tmp_num ?>: <input type="text" name="<?php echo $cat_num ?>"><br />
        Number Of Descriptors: 
        <select name="<?php echo $desc_num ?>">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
            <option value="6">6</option>
            <option value="7">7</option>
            <option value="8">8</option>
            <option value="9">9</option>
            <option value="10">10</option>
            <option value="1">11</option>
            <option value="2">12</option>
            <option value="3">13</option>
            <option value="4">14</option>
            <option value="5">15</option>
            <option value="6">16</option>
            <option value="7">17</option>
            <option value="8">18</option>
            <option value="9">19</option>
            <option value="10">20</option>
            <option value="1">21</option>
            <option value="2">22</option>
            <option value="3">23</option>
            <option value="4">24</option>
            <option value="5">25</option>
            <option value="6">26</option>
            <option value="7">27</option>
            <option value="8">28</option>
            <option value="9">29</option>
            <option value="10">30</option>
        </select>
        <br /><br />
<?php
         
    }
?>
        <input type="submit" value="submit">
     </form>
<?php        
        
       
}



if(isset($_GET['gw_id']) && isset($_GET['number_categories']) && isset($_GET['getdescriptors']) && !isset($_GET['getitemoptions']))
{
    $gw_id = $_GET['gw_id'];
    $num_cat = $_GET['number_categories'];
?>
    <form action="updateitem.php" method="POST">
        <input type="hidden" name="gw_id" value="<?php echo $gw_id ?>"/>
        <input type="hidden" name="number_categories" value="<?php echo $num_cat ?>"/>
        <input type="hidden" name="getdescriptors" value="getdescriptors"/>
        <input type="hidden" name="getitemoptions" value="getitemoptions"/>
        <input type="hidden" name="Edit_Button" value="Edit_Button"/>
<?php
    
    
    $tmp_num = 0;
    while($tmp_num != $num_cat)
    {
        $tmp_num++;
        $cat_num = "category" . $tmp_num;
        $desc_num = "descriptors" . $tmp_num;
        
        $cat_value = $_GET[$cat_num];
        $desc_value = $_GET[$desc_num];
        $html_cat_desc_name = $cat_num . "numberdescriptors";
?>  
        Category # <?php echo $tmp_num ?>: <input type="text" name="<?php echo $cat_num ?>" value="<?php echo $cat_value ?>"><br />
        <input type="hidden" name="<?php echo $html_cat_desc_name ?>" value="<?php echo $desc_value ?>"/>
<?php

        $tmp_option_num = 0;
        
        while($tmp_option_num != $desc_value)
        {
            $tmp_option_num++;
            $category_descriptor_number = $cat_num . "descriptor" . $tmp_option_num;
?>
            Descriptor # <?php echo $tmp_option_num ?>: <input type="text" name="<?php echo $category_descriptor_number ?>"><br />
            
<?php               
        } 
        echo '<br />';       
    }
?>
        <br /><br /><input type="submit" value="submit">
     </form>
<?php              
}
echo '</div>';
    
?>   
    
    
 










